(function () {
    angular.module('app')
        .component('xxRegisterCon', {
            templateUrl: '/app/RegisterCon/RegisterCon.html',
            controller: ctrl
        });

    function ctrl($scope,$state,$mdDialog,$cookies,RegisterConFactory,urlCnst) {
        $scope.status = '  ';
        $scope.customFullscreen = false;
        $scope.consultant = {
            username:"",
            password:"",
            company:'',
            tag:"",
            school:"",
            description:'',
        };
        $scope.registerCon = function (body) {
            if(!body['username']||!body['password']||!body['company']
                ||!body['tag']||!body['school']||!body['description']){
                urlCnst.notice('请将信息填写完整');
                return;
            }
            function cb(err,res) {
                if(!err)urlCnst.notice('注册咨询师成功');
                //console.log(err,res,body);
            }
            RegisterConFactory.registerCon(body,cb);
        }
        $scope.home = function () {
            $state.go('show.home')
        }
    }
})();
